package com.itheima.common;
/*
基于ThreadLocal封装类工具，用于保存和获取当前登录用户的文件
*/
//作用范围:某一个线程之内
public class BaseContext {
    private static ThreadLocal<Long> threadLocal=new ThreadLocal<> ();
    //保存id
    public static void setCurrentId(Long id){

        threadLocal.set (id);
    }
    public static Long getCurrent(){
        return threadLocal.get ();
    }
    /**
     * 删除存储的值
     */
    public static void remove(){
        threadLocal.remove();
    }
}